import request from '@/utils/request'

//查询音频列表
export function listAudio(query) {
    return request({
        url: '/audio/listAudio',
        method: 'get',
        params: query
    })
}

//添加音频
export function insertAudio(data) {
    return request({
        url: '/audio/insertAudio',
        method: 'post',
        data: data
    })
}

//删除音频信息
export function removeAudio(audioId) {
    return request({
        url: '/audio/' + audioId,
        method: 'delete'
    })
}

//状态修改
export function setAudioStatus(data) {
    return request({
        url: '/audio/setAudioStatus',
        method: 'put',
        data: data
    })
}

//点击播放音频发送请求
export function uploadProductImg(data) {
    return request({
        url: '/audio/upload',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        data: data
    })
}

// 根据 音频类型查询该类型的数量
export function getNumByAudioType(audioType) {
  return request({
    url: '/audio/getNumByAudioType/' + audioType,
    method: 'get'
  })
}
